import request from '@/axios';

/**
 * 好友
 * @param lastMessageId
 */
export const myFriend = (lastMessageId = "") => {
  return request({
    url: '/api/blade-anwise/im/im_friend/myFriend',
    method: 'get',
    params: {
      lastMessageId: lastMessageId,
    }
  })
};

/**
 * 消息列表
 * @param issueId
 * @param lastMessageId
 */
export const records = (issueId = "", lastMessageId = "") => {
  return request({
    url: '/api/blade-anwise/im/im_message/records',
    method: 'get',
    params: {
      issueId,
      lastMessageId,
    }
  })
};

/**
 * 已读
 * @param ids
 */
export const read = (issueId = "") => {
  return request({
    url: '/api/blade-anwise/im/im_message/read?issueId=' + issueId,
    method: 'post',
    data: {}
  })
}

/**
 * 获取用户信息
 * @param ids
 */
export const getUserInfo = (id) => {
  return request({
    url: '/api/blade-user/getInfo',
    method: 'get',
    params: {
      id,
    }
  })
}

